<template>
  <div style="padding: 6px;">
    <el-table :data="tblogObj.list" border style="width: 100%">
      <el-table-column label="更新条数" prop="uptatecount" width="120px"></el-table-column>
      <el-table-column label="日志时间" width="160px">
        <template v-slot="scope">
          <DateFormat :value="scope.row.logtime" :format="'YYYY-MM-DD HH:mm'"></DateFormat>
        </template>
      </el-table-column>
      <el-table-column label="日志内容" prop="neirong"></el-table-column>
    </el-table>
    <el-pagination class="center" background layout="total, prev, pager, next"
                   @current-change="loadTbWorkLog" :total="tblogObj.total"
                   :current-page.sync="queryParams.pageNum" :page-size="queryParams.pageSize">
    </el-pagination>
  </div>
</template>

<script>
import request from '@/utils/request'

export default {
  props:{
    workId:{
      type: Number,
      default: 0,
    }
  },
  data() {
    return {
      queryParams: {
        pageNum: 1,
        pageSize: 15,
        workId: this.workId
      },
      tblogObj: {}
    }
  },
  mounted() {
    this.loadTbWorkLog()
  },
  methods: {
    loadTbWorkLog() {
      request({
        url: '/tbwork/pagetbworklog',
        data: this.queryParams
      }).then(res => {
        const { data } = res
        this.tblogObj = data
      })
    },
  }
}
</script>
